package cn.icanci.loopstack.bic.web.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.icanci.loopstack.bic.biz.service.BuryingService;
import cn.icanci.loopstack.bic.common.model.BuryingVO;
import cn.icanci.loopstack.bic.common.result.R;
import cn.icanci.loopstack.bic.web.form.BuryingQueryForm;

/**
 * 埋点查询控制器
 * 
 * @author icanci
 * @since 1.0 Created in 2023/08/19 18:34
 */
@RestController
@RequestMapping("/bicAdmin/burying")
public class BuryingController {
    @Resource
    private BuryingService buryingService;

    @PostMapping("query")
    public R query(@RequestBody BuryingQueryForm form) {
        return R.builderOk().data("queryPage", buryingService.queryPage(form.getBurying(), form.getPaginator().getCurrentPage(), form.getPaginator().getPageSize())).build();
    }

    @PostMapping("saveForMock")
    public R saveForMock(@RequestBody BuryingVO burying) {
        buryingService.save(burying);
        return R.builderOk().build();
    }

}
